package com.meixiang.adapter.service;

import android.content.Context;
import android.content.Intent;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.meixiang.R;
import com.meixiang.activity.homes.service.BeautyClinicDetailActivity;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * 美服务-预约-项目 适配器
 */
public class BeautyClinicAdapter extends RecyclerView.Adapter<BeautyClinicAdapter.ViewHolder> {
    private Context mContext;
    @Override
    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        mContext=parent.getContext();
        View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_item_beauty_clinic, parent, false);
        return new ViewHolder(view);
    }

    @Override
    public void onBindViewHolder(ViewHolder holder, int position) {
        holder.view.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                mContext.startActivity(new Intent(mContext, BeautyClinicDetailActivity.class));
            }
        });
    }

    @Override
    public int getItemCount() {
        return 3;
    }

   static class ViewHolder extends RecyclerView.ViewHolder{
        View view;
        @Bind(R.id.iv_background)
        ImageView ivBackground;
        @Bind(R.id.tv_title)
        TextView tvTitle;
        @Bind(R.id.tv_money)
        TextView tvMoney;

        ViewHolder(View view) {
            super(view);
            this.view=view;
            ButterKnife.bind(this, view);
        }
    }
}
